package cn.stylefeng.guns.modular.merchant.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;

import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.common.page.LayuiPageFactory;
import cn.stylefeng.guns.modular.system.entity.SysConfType;
import cn.stylefeng.guns.modular.system.mapper.SysConfTypeMapper;
import cn.stylefeng.roses.core.util.ToolUtil;
import cn.stylefeng.roses.kernel.model.exception.ServiceException;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import cn.stylefeng.guns.modular.merchant.mapper.PluManagerPageMapper;
import cn.stylefeng.guns.modular.merchant.entity.ErpPlu;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

@Service
public class PluManagerPageService extends ServiceImpl<PluManagerPageMapper, ErpPlu> {

	@Autowired
	private PluManagerPageMapper pluManagerPageMapper;

	public Page<Map<String, Object>> list(String pluCode,String pluType) {
        Page page = LayuiPageFactory.defaultPage();
        return pluManagerPageMapper.list(page,pluCode,pluType);
    }


    /**
     * 删除菜品管理
     */
    @Transactional
    public void delete(String id) {
        //Dept dept = deptMapper.selectById(deptId);

        //根据like查询删除所有级联的部门
        //QueryWrapper<Dept> wrapper = new QueryWrapper>>();
        //wrapper = wrapper.like("PIDS", "%[" + dept.getDeptId() + "]%");
        //List<Dept> subDepts = deptMapper.selectList(wrapper);
        //for (Dept temp : subDepts) {
        //    this.removeById(temp.getDeptId());
        //}

        this.removeById(id);
    }

    /**
     * 新增菜品管理
     */
    @Transactional
    public boolean add(String param) {
    	//this.save(xx);
    	return true;
    }
}
